package com.airy.highSpeed.service.impl;


import com.airy.highSpeed.dao.oracle.StaLaneHeartBeatDao;
import com.airy.highSpeed.entity.StaLaneHeartBeatEntity;
import com.airy.highSpeed.service.StaLaneHeartBeatService;
import com.airy.highSpeed.utils.PageUtils;
import com.airy.highSpeed.utils.Query;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service("StaLaneHeartBeatService")
public class StaLaneHeartBeatServiceImpl extends ServiceImpl<StaLaneHeartBeatDao, StaLaneHeartBeatEntity> implements StaLaneHeartBeatService {

    @Autowired
    StaLaneHeartBeatDao staLaneHeartBeatDao;

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<StaLaneHeartBeatEntity> page = this.page(
                new Query<StaLaneHeartBeatEntity>().getPage(params),
                new QueryWrapper<StaLaneHeartBeatEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public List<StaLaneHeartBeatEntity> findAll() {
        return staLaneHeartBeatDao.findAll();
    }

    @Override
    public List<StaLaneHeartBeatEntity> findByTollStationId(String tollStationId) {
        return staLaneHeartBeatDao.findByTollStationId(tollStationId);
    }

}